define(['angular','app.controllers','services/common/base','filters/common/base'],function(angular,controllers,webUploader,videojs){
    'use strict';
    controllers.controller('updateUserPwdController' ,['$q','$resource','$scope','$uibModal','$uibModalInstance','Base','jewelleryService','model',function ($q,$resource,$scope,$uibModal, $uibModalInstance,Base,jewelleryService,model) {
        var error=function(err){
            alert(err.message);
        }
        $scope.cancel = function () {
            $uibModalInstance.dismiss();
        };
        $scope.uploadPwd=function(){

            if($scope.password_new!=$scope.password_confirm){
                alert("两次密码不一样");
                return false;
            }
            jewelleryService.updateUserPwd($scope.password,$scope.password_confirm,function(data){
                if(data.status==1){
                    alert("密码修改成功");
                }else{
                    alert("密码修改失败");
                }
            },error)
        }

    }]);
});